//
//  ViewController.m
//  16Practice
//
//  Created by dllo on 16/8/5.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "ViewController.h"
#import "CycleView.h"

@interface ViewController ()
@property (nonatomic, strong) NSMutableArray *picArray;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.picArray = [NSMutableArray array];
    for (NSInteger i = 0; i < 7; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%ld", i]];
        [self.picArray addObject:image];
    }
    NSString *first = [self.picArray firstObject];
    NSString *last = [self.picArray lastObject];
    
    [self.picArray addObject:first];
    [self.picArray insertObject:last atIndex:0];
    
    CycleView *cyImage = [[CycleView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 270)];
    [self.view addSubview:cyImage];
    cyImage.array = self.picArray;
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
